import myAxios from '@/utils/request'

export const getGoodsListApi = (params) =>
  myAxios.get('/goods-infos/page', { params: params })

export const addGoodsApi = (data) => myAxios.post('/goods-infos', data)

export const deleteGoodsApi = (ids) =>
  myAxios.delete(`/goods-infos`, {
    params: {
      ids: ids.join(',')
    }
  })

export const updateGoodsApi = (data) => myAxios.put('/goods-infos', data)

export const getGoodsByIdApi = (id) => myAxios.get(`/goods-infos/${id}`)

export const updateGoodsSellStatusApi = (id) =>
  myAxios.put(`/goods-infos/${id}`)
